home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 419_01 / odmg10 / util / scripts / ximake.sh < prev    next >
Encoding:
Text File  |  1993-09-09  |  776 b   |  44 lines

  1. :
  2.  
  3. #
  4. # script to generate a Makefile from an Imakefile.  Sometimes useful for 
  5. # generating Makefiles for stuff outside the X sources.
  6.  
  7. progname=$0
  8. xtop=$1
  9. what=$2
  10.  
  11. if [ x"$xtop" = x ]; then
  12.     echo "usage:  $progname  xsrctop  [whattomake]"
  13.     exit 1
  14. fi
  15.  
  16. if [ x"$what" = x ]; then
  17.     what="Makefile"
  18. fi
  19.  
  20. if [ ! -d $xtop ]; then
  21.     echo "$progname"":  no such directory $xtop"
  22.     exit 1
  23. fi
  24.  
  25. if [ ! -d $xtop/config ]; then
  26.     echo "$progname"":  no X configuration files under $xtop"
  27.     exit 1
  28. fi
  29.  
  30. if [ ! -f Imakefile ]; then
  31.     echo "$progname"":  can't find `pwd`/Imakefile"
  32.     exit 1
  33. fi
  34.  
  35. if [ -f $what ]; then
  36.     rm -f ${what}.bak
  37.     mv $what ${what}.bak
  38. fi
  39.  
  40. echo "Making $what from Imakefile"
  41. PATH=$xtop/util/imake:$PATH \
  42. imake -DTOPDIR=$xtop -I$xtop/config $what
  43.